1
|
|
|
import React, { Component, Fragment } from "react" |
2
|
|
|
import { graphql } from "gatsby" |
3
|
|
|
|
4
|
|
|
import Layout from "../layouts/index" |
5
|
|
|
|
6
|
|
|
import SEO from "../components/seo" |
7
|
|
|
import MetaMatches from "../components/meta-matches" |
8
|
|
|
import MatchesOverview from "../components/matches-overview" |
9
|
|
|
import MatchesSlider from "../components/matches-slider" |
10
|
|
|
import { |
11
|
|
|
NewsItemFeatured, |
12
|
|
|
NewsItemCardRatio, |
13
|
|
|
KcvvTvCard, |
14
|
|
|
} from "../components/news-item" |
15
|
|
|
import { CardImage } from "../components/cards" |
16
|
|
|
import UpcomingEvent from "../components/upcoming-event" |
17
|
|
|
import PlayerFeatured from "../components/player--featured" |
18
|
|
|
|
19
|
|
|
import MyMakro from "../images/tag-mymakro.png" |
20
|
|
|
import Trooper from "../images/tag-trooper.png" |
21
|
|
|
|
22
|
|
|
class IndexPage extends Component { |
23
|
|
|
renderMatchSlider = () => ( |
24
|
|
|
<section className={"grid-container full"}> |
25
|
|
|
<MatchesSlider season="2021" regnumber="00055" /> |
26
|
|
|
</section> |
27
|
|
|
) |
28
|
|
|
renderSocialMediaArticle = () => ( |
29
|
|
|
<article className={"medium-6 large-12 cell social"}> |
30
|
|
|
<div className={"social-sidebar__wrapper"}> |
31
|
|
|
<a |
32
|
|
|
href="https://facebook.com/KCVVElewijt" |
33
|
|
|
className="btn-social-counter btn-social-counter--fb" |
34
|
|
|
target="_blank" |
35
|
|
|
rel="noopener noreferrer" |
36
|
|
|
> |
37
|
|
|
<div className="btn-social-counter__icon"> |
38
|
|
|
<i className="fa fa-facebook"></i> |
39
|
|
|
</div> |
40
|
|
|
<h5 className="btn-social-counter__title"> |
41
|
|
|
Volg onze Facebook pagina |
42
|
|
|
</h5> |
43
|
|
|
</a> |
44
|
|
|
<a |
45
|
|
|
href="https://twitter.com/kcvve" |
46
|
|
|
className="btn-social-counter btn-social-counter--twitter" |
47
|
|
|
target="_blank" |
48
|
|
|
rel="noopener noreferrer" |
49
|
|
|
> |
50
|
|
|
<div className="btn-social-counter__icon"> |
51
|
|
|
<i className="fa fa-twitter"></i> |
52
|
|
|
</div> |
53
|
|
|
<h5 className="btn-social-counter__title">Volg ons op Twitter</h5> |
54
|
|
|
</a> |
55
|
|
|
<a |
56
|
|
|
href="http://www.instagram.com/kcvve" |
57
|
|
|
className="btn-social-counter btn-social-counter--instagram" |
58
|
|
|
target="_blank" |
59
|
|
|
rel="noopener noreferrer" |
60
|
|
|
> |
61
|
|
|
<div className="btn-social-counter__icon"> |
62
|
|
|
<i className="fa fa-instagram"></i> |
63
|
|
|
</div> |
64
|
|
|
<h5 className="btn-social-counter__title">Volg ons op Instagram</h5> |
65
|
|
|
</a> |
66
|
|
|
</div> |
67
|
|
|
</article> |
68
|
|
|
) |
69
|
|
|
renderMakroArticle = () => ( |
70
|
|
|
<article className={"medium-6 large-12 cell card"}> |
71
|
|
|
<header className={"card__header"}> |
72
|
|
|
<h4>MyMakro</h4> |
73
|
|
|
</header> |
74
|
|
|
<div className={"card__content"}> |
75
|
|
|
<p> |
76
|
|
|
Link nu jouw Makro voordeelkaart aan onze vereniging. Bij elke aankoop |
77
|
|
|
bij Makro en partners steun je KCVV Elewijt! |
78
|
|
|
</p> |
79
|
|
|
<p> |
80
|
|
|
<img src={MyMakro} alt="QR Code MyMakro" style={{ width: "100%" }} /> |
81
|
|
|
</p> |
82
|
|
|
<p> |
83
|
|
|
Scan bovenstaande QR-code met je camera op GSM, of surf naar{" "} |
84
|
|
|
<a |
85
|
|
|
href="https://my.makro.be/nl/link-vereniging/02277464" |
86
|
|
|
target="_blank" |
87
|
|
|
rel="noopener noreferrer" |
88
|
|
|
title="MyMakro link voor KCVV Elewijt" |
89
|
|
|
className={"rich-link"} |
90
|
|
|
> |
91
|
|
|
https://my.makro.be/nl/link-vereniging/02277464 |
92
|
|
|
</a> |
93
|
|
|
. |
94
|
|
|
</p> |
95
|
|
|
<p>Onze vereniging dankt jullie van harte!</p> |
96
|
|
|
</div> |
97
|
|
|
</article> |
98
|
|
|
) |
99
|
|
|
renderTrooperArticle = () => ( |
100
|
|
|
<article className={"medium-6 large-12 cell card"}> |
101
|
|
|
<header className={"card__header"}> |
102
|
|
|
<h4>Trooper</h4> |
103
|
|
|
</header> |
104
|
|
|
<div className={"card__content"}> |
105
|
|
|
<p> |
106
|
|
|
Trooper werkt samen met een groot aantal webshops die zich in de |
107
|
|
|
kijker willen zetten. In ruil voor een extra klik via Trooper krijgen |
108
|
|
|
wij een percentje op jouw volgende bestelling. |
109
|
|
|
</p> |
110
|
|
|
<p> |
111
|
|
|
<img src={Trooper} alt="QR Code Trooper" style={{ width: "100%" }} /> |
112
|
|
|
</p> |
113
|
|
|
<p> |
114
|
|
|
Scan bovenstaande QR-code met je camera op GSM, of surf naar{" "} |
115
|
|
|
<a |
116
|
|
|
href="https://trooper.be/kcvvelewijt" |
117
|
|
|
target="_blank" |
118
|
|
|
rel="noopener noreferrer" |
119
|
|
|
title="Trooper link voor KCVV Elewijt" |
120
|
|
|
className={"rich-link"} |
121
|
|
|
> |
122
|
|
|
https://trooper.be/kcvvelewijt |
123
|
|
|
</a> |
124
|
|
|
. |
125
|
|
|
</p> |
126
|
|
|
<p> |
127
|
|
|
<a |
128
|
|
|
href="/news/2020-04-12-steun-kcvv-elewijt-trooper-mymakro" |
129
|
|
|
className={"rich-link"} |
130
|
|
|
> |
131
|
|
|
Lees er hier meer over! |
132
|
|
|
</a> |
133
|
|
|
</p> |
134
|
|
|
</div> |
135
|
|
|
</article> |
136
|
|
|
) |
137
|
|
|
renderYouthCalendarArticle = () => ( |
138
|
|
|
<article className={"medium-6 large-12 cell card"}> |
139
|
|
|
<header className="card__header"> |
140
|
|
|
<h4>Jeugdploegen</h4> |
141
|
|
|
</header> |
142
|
|
|
<MatchesOverview season="2021" regnumber="00055" exclude="['2A', '4E']" /> |
143
|
|
|
</article> |
144
|
|
|
) |
145
|
|
|
|
146
|
|
|
renderBTeamCalendarArticle = () => ( |
147
|
|
|
<article className={"medium-6 large-12 cell card"}> |
148
|
|
|
<header className={"card__header"}> |
149
|
|
|
<h4>The B-Team</h4> |
150
|
|
|
</header> |
151
|
|
|
<MetaMatches season="2021" region="bra" division="4E" regnumber="00055" /> |
152
|
|
|
</article> |
153
|
|
|
) |
154
|
|
|
renderATeamCalendarArticle = () => ( |
155
|
|
|
<article className={"medium-6 large-12 cell card"}> |
156
|
|
|
<header className={"card__header"}> |
157
|
|
|
<h4>The A-Team</h4> |
158
|
|
|
</header> |
159
|
|
|
<MetaMatches season="2021" region="bra" division="2A" regnumber="00055" /> |
160
|
|
|
</article> |
161
|
|
|
) |
162
|
|
|
|
163
|
|
|
renderWebsiteFeedbackArticle = () => ( |
164
|
|
|
<article className={"medium-6 large-12 cell card"}> |
165
|
|
|
<header className={"card__header"}> |
166
|
|
|
<h4> |
167
|
|
|
<i className={"fa fa-commenting-o"} aria-hidden="true"></i> Website |
168
|
|
|
feedback |
169
|
|
|
</h4> |
170
|
|
|
</header> |
171
|
|
|
<div className={"card__content"}> |
172
|
|
|
<p> |
173
|
|
|
Na lang zwoegen is onze nieuwe website eíndelijk online geraakt! We |
174
|
|
|
zijn heel benieuwd naar jullie mening of feedback. Als jullie vinden |
175
|
|
|
dat er iets ontbreekt, of als je bepaalde fouten tegenkomt, zouden we |
176
|
|
|
het ten zeerste appreciëren als je ons even iets laat weten op{" "} |
177
|
|
|
<a href="mailto:[email protected]" className={"rich-link"}> |
178
|
|
|
[email protected] |
179
|
|
|
</a> |
180
|
|
|
! |
181
|
|
|
</p> |
182
|
|
|
</div> |
183
|
|
|
</article> |
184
|
|
|
) |
185
|
|
|
renderExtraContentFooter = (corona) => ( |
186
|
|
|
<section className="grid-container site-content"> |
187
|
|
|
<div className="grid-x grid-margin-x"> |
188
|
|
|
<section className={"cell large-12 featured-article"}> |
189
|
|
|
<CardImage |
190
|
|
|
title="Update corona maatregelen." |
191
|
|
|
localFile={corona} |
192
|
|
|
link="/news/2020-07-26-covid-19-geen-senior-wedstrijden-tot-minstens-25-augustus-update-2907" |
193
|
|
|
metadata={false} |
194
|
|
|
/> |
195
|
|
|
</section> |
196
|
|
|
</div> |
197
|
|
|
</section> |
198
|
|
|
) |
199
|
|
|
|
200
|
|
|
// convertGraphqlToPlayerObject = (player) => { |
201
|
|
|
// return { |
202
|
|
|
// nameFirst: player.field_firstname, |
203
|
|
|
// nameLast: player.field_lastname, |
204
|
|
|
// shirtNr: player.field_shirtnumber, |
205
|
|
|
// position: player.field_position, |
206
|
|
|
// gamesPlayed: player.field_stats_games, |
207
|
|
|
// cleanSheets: player.field_stats_cleansheets, |
208
|
|
|
// goalsScored: player.field_stats_goals, |
209
|
|
|
// cardsYellow: player.field_stats_cards_yellow, |
210
|
|
|
// cardsRed: player.field_stats_cards_red, |
211
|
|
|
// imageSrc: |
212
|
|
|
// player.relationships.field_image.localFile.childImageSharp.fixed.src, |
213
|
|
|
// link: player.path.alias, |
214
|
|
|
// } |
215
|
|
|
// } |
216
|
|
|
|
217
|
|
|
// renderPlayerOfTheWeek = (featuredPlayer) => |
218
|
|
|
// featuredPlayer.edges.map( |
219
|
|
|
// ({ node: potw }) => |
220
|
|
|
// potw.relationships.field_player && ( |
221
|
|
|
// <article |
222
|
|
|
// className={"medium-6 large-12 cell card"} |
223
|
|
|
// key={potw.relationships.field_player.field_firstname} |
224
|
|
|
// > |
225
|
|
|
// <header className={"card__header"}> |
226
|
|
|
// <h4>Speler van de week</h4> |
227
|
|
|
// </header> |
228
|
|
|
// <PlayerFeatured |
229
|
|
|
// player={this.convertGraphqlToPlayerObject( |
230
|
|
|
// potw.relationships.field_player |
231
|
|
|
// )} |
232
|
|
|
// /> |
233
|
|
|
// </article> |
234
|
|
|
// ) |
235
|
|
|
// ) |
236
|
|
|
|
237
|
|
|
renderPosts = (posts) => { |
238
|
|
|
let articleCount = 0 |
239
|
|
|
let kcvvTvCount = 0 |
240
|
|
|
|
241
|
|
|
return posts.map(({ node }, i) => { |
242
|
|
|
switch (node.internal.type) { |
243
|
|
|
case "node__article": |
244
|
|
|
node.field_featured && (articleCount = articleCount + 2) |
245
|
|
|
!node.field_featured && articleCount++ |
246
|
|
|
return ( |
247
|
|
|
<Fragment key={i}> |
248
|
|
|
{node.field_featured && <NewsItemFeatured node={node} />} |
249
|
|
|
{!node.field_featured && ( |
250
|
|
|
<NewsItemCardRatio node={node} teaser={true} /> |
251
|
|
|
)} |
252
|
|
|
</Fragment> |
253
|
|
|
) |
254
|
|
|
case "node__kcvv_tv": |
255
|
|
|
if (kcvvTvCount === 0) { |
256
|
|
|
articleCount = articleCount + 2 |
257
|
|
|
kcvvTvCount++ |
258
|
|
|
return ( |
259
|
|
|
<CardImage |
260
|
|
|
title={node.title} |
261
|
|
|
localFile={ |
262
|
|
|
node.relationships.field_media_article_image.relationships |
263
|
|
|
.field_media_image.localFile |
264
|
|
|
} |
265
|
|
|
link={node.field_website.uri} |
266
|
|
|
metadata={false} |
267
|
|
|
key={i} |
268
|
|
|
/> |
269
|
|
|
) |
270
|
|
|
} else { |
271
|
|
|
articleCount = articleCount + 2 |
272
|
|
|
kcvvTvCount++ |
273
|
|
|
return <KcvvTvCard node={node} teaser={true} key={i} /> |
274
|
|
|
} |
275
|
|
|
|
276
|
|
|
default: |
277
|
|
|
return "" |
278
|
|
|
} |
279
|
|
|
}) |
280
|
|
|
} |
281
|
|
|
|
282
|
|
|
combineAndSortPosts = (featuredPosts, kcvvTv) => { |
283
|
|
|
return [...featuredPosts.edges, ...kcvvTv.edges].sort((a, b) => |
284
|
|
|
a.node.timestamp < b.node.timestamp |
285
|
|
|
? 1 |
286
|
|
|
: b.node.timestamp < a.node.timestamp |
287
|
|
|
? -1 |
288
|
|
|
: 0 |
289
|
|
|
) |
290
|
|
|
} |
291
|
|
|
|
292
|
|
|
renderLayoutSidebar = () => { |
293
|
|
|
const { featuredPlayer } = this.props.data |
294
|
|
|
return ( |
295
|
|
|
<> |
296
|
|
|
{/* A TEAM OVERVIEW - SUMMARY OF MATCHES AND RANKING*/} |
297
|
|
|
{this.renderATeamCalendarArticle()} |
298
|
|
|
|
299
|
|
|
{/* B TEAM OVERVIEW - SUMMARY OF MATCHES AND RANKING */} |
300
|
|
|
{this.renderBTeamCalendarArticle()} |
301
|
|
|
|
302
|
|
|
{/* YOUTH TEAMS OVERVIEW - SUMMARY OF UPCOMING MATCHES */} |
303
|
|
|
{this.renderYouthCalendarArticle()} |
304
|
|
|
|
305
|
|
|
{/* PLAYER OF THE WEEK ARTICLE IF ANY */} |
306
|
|
|
{/* {featuredPlayer && this.renderPlayerOfTheWeek(featuredPlayer)} */} |
307
|
|
|
|
308
|
|
|
{/* INFO ARTICLE WITH SOCIAL MEDIA LINKS */} |
309
|
|
|
{this.renderSocialMediaArticle()} |
310
|
|
|
|
311
|
|
|
{/* INFO ARTICLE WITH REQUEST FOR WEBSITE FEEDBACK */} |
312
|
|
|
{this.renderWebsiteFeedbackArticle()} |
313
|
|
|
|
314
|
|
|
{/* INFO ARTICLE WITH "TROOPER" CONTENT */} |
315
|
|
|
{this.renderTrooperArticle()} |
316
|
|
|
|
317
|
|
|
{/* INFO ARTICLE WITH "MYMAKRO" CONTENT */} |
318
|
|
|
{this.renderMakroArticle()} |
319
|
|
|
</> |
320
|
|
|
) |
321
|
|
|
} |
322
|
|
|
|
323
|
|
|
renderLayoutMain = () => { |
324
|
|
|
const { featuredPosts, kcvvTv } = this.props.data |
325
|
|
|
const posts = this.combineAndSortPosts(featuredPosts, kcvvTv) |
326
|
|
|
|
327
|
|
|
return ( |
328
|
|
|
<> |
329
|
|
|
<UpcomingEvent /> |
330
|
|
|
|
331
|
|
|
{posts && this.renderPosts(posts)} |
332
|
|
|
</> |
333
|
|
|
) |
334
|
|
|
} |
335
|
|
|
|
336
|
|
|
render() { |
337
|
|
|
return ( |
338
|
|
|
<Layout> |
339
|
|
|
<SEO |
340
|
|
|
lang="nl-BE" |
341
|
|
|
title="Er is maar één plezante compagnie" |
342
|
|
|
description="Startpagina van stamnummer 00055: KCVV Elewijt." |
343
|
|
|
/> |
344
|
|
|
{this.renderExtraContentFooter(this.props.data.corona)} |
345
|
|
|
|
346
|
|
|
<section className="grid-container site-content"> |
347
|
|
|
{/* LIMITED-WIDTH CONTAINER WITH EXTRA (STICKY) CONTENT, IF ANY */} |
348
|
|
|
|
349
|
|
|
<div className="grid-x grid-margin-x"> |
350
|
|
|
<section className="cell large-8 news_overview__wrapper"> |
351
|
|
|
{/* MAIN CONTENT AREA */} |
352
|
|
|
{this.renderLayoutMain()} |
353
|
|
|
</section> |
354
|
|
|
<aside className="cell large-4"> |
355
|
|
|
<section className="grid-x featured__matches grid-margin-x"> |
356
|
|
|
{/* SIDEBAR CONTENT */} |
357
|
|
|
{this.renderLayoutSidebar()} |
358
|
|
|
</section> |
359
|
|
|
</aside> |
360
|
|
|
</div> |
361
|
|
|
</section> |
362
|
|
|
|
363
|
|
|
{/* FULL-WIDTH SLICK SLIDER WITH UPCOMING MATCHES */} |
364
|
|
|
{this.renderMatchSlider()} |
365
|
|
|
</Layout> |
366
|
|
|
) |
367
|
|
|
} |
368
|
|
|
} |
369
|
|
|
|
370
|
|
|
export const pageQuery = graphql` |
371
|
|
|
query { |
372
|
|
|
featuredPosts: allNodeArticle( |
373
|
|
|
filter: { status: { eq: true }, promote: { eq: true } } |
374
|
|
|
sort: { fields: changed, order: DESC } |
375
|
|
|
limit: 10 |
376
|
|
|
) { |
377
|
|
|
edges { |
378
|
|
|
node { |
379
|
|
|
id |
380
|
|
|
path { |
381
|
|
|
alias |
382
|
|
|
} |
383
|
|
|
created(formatString: "D/M/YYYY") |
384
|
|
|
changed(formatString: "D/M/YYYY") |
385
|
|
|
timestamp: changed(formatString: "x") |
386
|
|
|
title |
387
|
|
|
promote |
388
|
|
|
status |
389
|
|
|
field_featured |
390
|
|
|
body { |
391
|
|
|
value |
392
|
|
|
format |
393
|
|
|
processed |
394
|
|
|
summary |
395
|
|
|
} |
396
|
|
|
relationships { |
397
|
|
|
field_media_article_image { |
398
|
|
|
...ArticleImage |
399
|
|
|
} |
400
|
|
|
field_tags { |
401
|
|
|
name |
402
|
|
|
path { |
403
|
|
|
alias |
404
|
|
|
} |
405
|
|
|
} |
406
|
|
|
} |
407
|
|
|
internal { |
408
|
|
|
type |
409
|
|
|
} |
410
|
|
|
} |
411
|
|
|
} |
412
|
|
|
} |
413
|
|
|
preseason: file(name: { eq: "preseason2020" }) { |
414
|
|
|
...KCVVFluid960 |
415
|
|
|
} |
416
|
|
|
corona: file(name: { eq: "corona" }) { |
417
|
|
|
...KCVVFluid960 |
418
|
|
|
} |
419
|
|
|
kcvvTv: allNodeKcvvTv( |
420
|
|
|
filter: { status: { eq: true }, promote: { eq: true } } |
421
|
|
|
sort: { fields: created, order: DESC } |
422
|
|
|
limit: 5 |
423
|
|
|
) { |
424
|
|
|
edges { |
425
|
|
|
node { |
426
|
|
|
id |
427
|
|
|
created(formatString: "D/M/YYYY") |
428
|
|
|
title |
429
|
|
|
timestamp: created(formatString: "x") |
430
|
|
|
relationships { |
431
|
|
|
field_media_article_image { |
432
|
|
|
...ArticleImage |
433
|
|
|
} |
434
|
|
|
} |
435
|
|
|
field_website { |
436
|
|
|
uri |
437
|
|
|
} |
438
|
|
|
internal { |
439
|
|
|
type |
440
|
|
|
} |
441
|
|
|
} |
442
|
|
|
} |
443
|
|
|
} |
444
|
|
|
featuredPlayer: allNodePotw( |
445
|
|
|
sort: { fields: created, order: DESC } |
446
|
|
|
filter: { status: { eq: true } } |
447
|
|
|
limit: 1 |
448
|
|
|
) { |
449
|
|
|
edges { |
450
|
|
|
node { |
451
|
|
|
relationships { |
452
|
|
|
field_player { |
453
|
|
|
field_firstname |
454
|
|
|
field_lastname |
455
|
|
|
field_shirtnumber |
456
|
|
|
field_stats_games |
457
|
|
|
field_position |
458
|
|
|
field_stats_cleansheets |
459
|
|
|
field_stats_goals |
460
|
|
|
field_stats_cards_yellow |
461
|
|
|
field_stats_cards_red |
462
|
|
|
relationships { |
463
|
|
|
field_image { |
464
|
|
|
localFile { |
465
|
|
|
...KCVVFixedPlayerTeaser |
466
|
|
|
} |
467
|
|
|
} |
468
|
|
|
} |
469
|
|
|
path { |
470
|
|
|
alias |
471
|
|
|
} |
472
|
|
|
} |
473
|
|
|
} |
474
|
|
|
} |
475
|
|
|
} |
476
|
|
|
} |
477
|
|
|
} |
478
|
|
|
` |
479
|
|
|
|
480
|
|
|
export default IndexPage |
481
|
|
|
|